/*
 * Copyright (c)  2016, dabing.io
 * All rights reserved.
 * CustomerEntity.java 2017-09-16 上午7:30
 */

package com.ueboot.weishop.entity.customer;

import com.ueboot.weishop.entity.IDEntity;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;

/**
 * 描述:客户发票信息维护表
 * 客户填写的发票信息。
 *
 * @author yangkui create on 2017-09-16.
 * @since 1.0
 */
@Data
@NoArgsConstructor
@Entity(name = "WS_CUS_INVOICE")
public class CustomerInvoiceEntity extends IDEntity {


    public static final  String  INVOIVETYPE_GRFP="个人发票";
    public static final  String  INVOIVETYPE_PTZZS="普通增值税";
    public static final  String  INVOIVETYPE_ZYZZS="专用增值税";

    @Id
    @GeneratedValue(strategy = GenerationType.TABLE, generator = "WS_CUS_INVOICE")
    @GenericGenerator(name = "WS_CUS_INVOICE", strategy = "enhanced-table", parameters = {
            @org.hibernate.annotations.Parameter(name = "table_name", value = "WS_TABLE_SEQUENCE"),
            @org.hibernate.annotations.Parameter(name = "segment_value", value = "WS_CUS_INVOICE"),
            @org.hibernate.annotations.Parameter(name = "optimizer", value = "pooled")})
    @Column(name = "ID", columnDefinition = "INT(20) COMMENT 'id主键'", length = 20)
    private Long id;

    /**
     * 发票类型 个人 公司
     */
    @Column(name = "INVOICE_TYPE",columnDefinition = "VARCHAR(40) COMMENT '发票类型 个人 公司'",length = 40)
    private String invoiceType;
    /**
     * 户名
     */
    @Column(name = "TITLE_NAME",columnDefinition = "VARCHAR(200) COMMENT '户名'",length = 200)
    private String titleName;
    /**
     * 开户银行
     */
    @Column(name = "DEPOSIT_BANK",columnDefinition = "VARCHAR(200) COMMENT '开户银行'",length = 200)
    private String depositBank;
    /**
     * 公司地址
     */
    @Column(name = "COMPANY_ADDRESS",columnDefinition = "VARCHAR(200) COMMENT '公司地址'",length = 200)
    private String companyAddress;
    /**
     * 账号
     */
    @Column(name = "ACCOUNT_NO",columnDefinition = "VARCHAR(200) COMMENT '账号'",length = 200)
    private String accountNo;
    /**
     * 税号
     */
    @Column(name = "TAX_FILE_NUMBER",columnDefinition = "VARCHAR(200) COMMENT '税号'",length = 200)
    private String taxFileNumber;

    /**
     * 是否默认
     */
    @Column(name = "DEFAULT_INVOICE",columnDefinition = "INT(1) COMMENT '是否默认'",length = 1)
    private Boolean defaultInvoice;

    /**
     * 所属客户
     */
    @ManyToOne
    @JoinColumn(name="CUSTOMER_ID",columnDefinition = "INT(20) COMMENT '所属客户'")
    private CustomerInfoEntity customer;

}